<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?>            <div class="ad-300x250">
                <a href="#"><img src="<?php echo $GLOBALS['cfg_templets_skin']; ?>/img/ad-300x250.jpg" /></a>
            </div>
            <!-- ad-300x250:END -->
            <div class="mod-box mod-teacher">
                <div class="mod-box-head">
                    <h4 class="title">本周推荐PS老师 </h4>
                </div>
                <div class="mod-box-body clearfix">
                    <span><a href="#" class="thumb"><img src="http://www.23ps.com/Files/UserLogo/20090109/200901091248476145.jpg"></a></span>
                    <div class="name">
                        <strong><a href="#">眠</a></strong><br/>
                        性别：女<br/>
                        等级：普通会员<br/>
                    </div>
                    <div class="info">
                        用户积分：1805<br/>
                        发布教程数：<a href="#">36</a><br/>
                        拥有学生数：0<br/>
                    </div>
                    <a href="#" class="more">查看更多</a>
                </div>
                <div class="mod-box-foot">
                </div>
            </div>
            <!-- Teacher:END -->
            <div class="mod-box mod-ranking">
                <div class="mod-box-head">
                    <h4 class="title">投稿排行榜</h4>
                </div>
                <div class="mod-box-body clearfix">
                    <ol id="rankingList">
                    <?php
$atts = array();
$atts['tagname'] = 'sql';
$atts['sql'] = 'select *,count(mid) as t from ps_archives group by mid order by t desc limit 10';
$blockValue = MakePublicTag($atts,$this->refObj,$fields); 
if(is_array($blockValue) && count($blockValue) > 0){
foreach( $blockValue as $key=>$fields )
{
?>
	                    [field:global runphp='yes' name=autoindex]
	                  	if (@me == 1) {
	                  		@me = '<li class="show">';
	                  	}else{
	                  	    @me = '<li>';
	                  	}
	                    [/field:global]

                        [field:mid runphp='yes']
                                	$dsql = new dedesql();
                                	$mid = intval(@me);
                                	if($mid == 0) {
                                		$mid = 1;
                                	}
                                	$user = $dsql->getOne("select mid,userid,face,uname from ps_member where mid=".$mid);
                                	if(empty($user['userid'])){
                                		$user['userid'] = 'admin';
                                	}
                                	if(empty($user['face'])){
                                		$user['face'] = "/member/templets/images/dfgirl.png";
                                	}
                                	@me = "<a href='/member/index.php?uid=".$user['userid']."' class='thumb'><img src='".$user['face']."' onerror=\"this.src='/member/templets/images/dfgirl.png'\" width='50px' height='35px'></a>";
                                [/field:mid]
                        <span>[field:t/]篇</span>[field:mid runphp='yes']
                                	$dsql = new dedesql();
                                	$mid = intval(@me);
                                	if($mid == 0) {
                                		$mid = 1;
                                	}
                                	$user = $dsql->getOne("select mid,userid,uname from ps_member where mid=".$mid);
                                	if(empty($user['userid'])){
                                		$username = $user['userid'] = 'admin';
                                	}else if(!empty($user['uname'])){
                                		$username = $user['uname'];
                                	}else{
                                		$username = $user['userid'];
                                	}
                                	@me = "<a href='/member/index.php?uid=".$user['userid']."'>";
                                [/field:mid][field:global name=autoindex/]： [field:mid runphp='yes']
                                	$dsql = new dedesql();
                                	$mid = intval(@me);
                                	if($mid == 0) {
                                		$mid = 1;
                                	}
                                	$user = $dsql->getOne("select mid,userid,uname from ps_member where mid=".$mid);
                                	if(empty($user['userid'])){
                                		$username = $user['userid'] = 'admin';
                                	}else if(!empty($user['uname'])){
                                		$username = $user['uname'];
                                	}else{
                                		$username = $user['userid'];
                                	}
                                	@me = $username."</a>";
                                [/field:mid]</a>              
                        </li>
                    <?php
}
}
?>
                        
                    </ol>
                </div>
                <div class="mod-box-foot">
                    <a href="/member/article_add.php">我要投稿</a>
                </div>
            </div>
            <!-- Ranking:END -->
            <div class="download"><a href="#"><img src="<?php echo $GLOBALS['cfg_templets_skin']; ?>/img/download.png" /></a></div>